<template>
<span class="opera_model-wrapper">
  <button v-if="col.btns.WITHDRAWAUDIT&&status!=8&&status!=10" class="ui button primary mini" @click.stop.prevent="withdrawAudit(col.val)"
            title="审核" >{{col.btns.WITHDRAWAUDIT}}</button>
  <button v-if="col.btns.PAYMENTRECORD" class="ui button primary mini" @click.stop.prevent="paymentRecord(col.val)"
              title="付款记录">{{col.btns.PAYMENTRECORD}}</button>
  <button v-if="col.btns.SEEDETAIL" class="ui button primary mini" @click.stop.prevent="seeDetail(col.val)"
                title="查看">{{col.btns.SEEDETAIL}}</button>
</span>
</template>
<script type="text/ecmascript-6">
    import tool from 'src/util/tool';
    import util from '_util/index';
    import logic from '_logic';
    export default {
        data() {
            return {}
        },
        methods: {
            withdrawAudit(id){
                /**
                 * 触发mypop.vue下showPopCom监听事件 显示withDrawAudit模板
                 * */
                this.$store.state.global.eventVue.$emit('showPopCom', {_this: this, id: id, name: 'withdrawAudit',data:{operateShow:true}});
            },
            seeDetail(id){
                /**
                 * 触发mypop.vue下showPopCom监听事件 显示seeDetail模板
                 * */
                 this.$store.state.global.eventVue.$emit('showPopCom', {_this: this, id: id, name: 'seeDetail',data:{operateShow:false}});
            },
            paymentRecord(id){
                 this.isUnitValid({withdraw_id: id}, ()=>{
                              this.$router.push(`/page/list?ctl=TransferDetail&withdraw_id=${id}`);
                            })
            },
            isUnitValid(params, cb){
                 let url = tool.getApi(this, "TransferDetail", "index");
                 util.http.SR(this, url, params, null,(rs)=>{
                    cb();
                 });
            }
        },
        computed: {
            ctl(){
                return this.$route.query.ctl;
            },
            is_admin(){
                return util.is_admin(this);
            },
            status(){
                return logic.detail.getDetail(this, this._id,'status').val;
            },
        },
        watch: {},

        props: ['col', '_id', 'detail_info'],
        created() {
        },
    }
</script>
<style rel="stylesheet/less" lang="less"></style>
